import { PORT_CareMission } from "@/api/config/servicePort";
import http from "@/api";
import type { CareMission } from "@/api/interface";

/**
 * @name 照护项目管理模块
 */
// 获取照护项目列表
export const getCareMissionList = () => {
  return http.get<CareMission.ResCareMission[]>(PORT_CareMission + `/list`);
};

/**
 * 保存照护项目
 * @param data 照护项目保存请求参数
 * @returns 保存结果
 */
export const saveCareMission = (data: CareMission.ReqCareMissionSaveParams) => {
  return http.post<number>(PORT_CareMission + `/save`, data);
};

/**
 * 删除照护项目
 * @param data 照护项目删除请求参数
 * @returns 删除结果
 */
export const deleteCareMission = (id: number) => {
  return http.post<boolean>(PORT_CareMission + `/delete?id=${id}`);
};
